package o2o.web.actions.system;

import com.jinyou.utils.common.AjaxResult;
import o2o.web.actions.system.token.MemTokenUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class SystemController {


    // 备份token
    @RequestMapping(method = RequestMethod.POST, value = "/system/token/bak")
    @ResponseBody
    public String sysAreaList() {
        MemTokenUtils.saveAllToken();

        return AjaxResult.successResult();
    }


    // 还原token
    @RequestMapping(method = RequestMethod.POST, value = "/system/token/reback")
    @ResponseBody
    public String reBackToken() {
        MemTokenUtils.reBackToken();
        return AjaxResult.successResult();
    }
}
